package br.net.woodstock.tickettoride.web.seam.access;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.Conversation;

import br.net.woodstock.tickettoride.web.jsf.access.common.AbstractMenuBean;

@Name("menuBean")
@Scope(ScopeType.SESSION)
public class MenuBean extends AbstractMenuBean {

	private static final long	serialVersionUID	= -2388650344847820940L;

	public MenuBean() {
		super();
	}

	@Override
	public boolean isEnabled() {
		Conversation conversation = Conversation.instance();
		// Manager.instance().killAllOtherConversations();
		if (conversation != null) {
			// TicketLog.getLog().warning("Current: " + conversation.getId() + " => " + conversation.isLongRunning() + " => " + conversation.getViewId());
			if (conversation.isLongRunning()) {
				return false;
			}
		}

		return true;
	}

}
